Using the Pythagoras theorem